package cn.cvs.service.impl;

import cn.cvs.dao.StorageRecordMapper;
import cn.cvs.pojo.StorageRecord;
import cn.cvs.service.StorageRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StorageRecordServiceImpl implements StorageRecordService {
    @Resource
    StorageRecordMapper storageRecordMapper;
    @Override
    public List<StorageRecord> queryAll() {
        return storageRecordMapper.queryAll();
    }

    @Override
    public List<StorageRecord> queryPage(Integer pageBegin, Integer pageSize) {
        return null;
    }

    @Override
    public List<StorageRecord> queryStorage(String goodsName, Integer supplierId, Integer payStatus, Integer pageNo, Integer pageSize) {
        List<StorageRecord> records = storageRecordMapper.queryByPage(goodsName, supplierId, payStatus, (pageNo - 1) * pageSize, pageSize);
        return records;
    }

    @Override
    public List<StorageRecord> queryByPage(String goodsName, Integer supplierId, Integer payStatus, Integer pageBegin, Integer pageSize) {
        return null;
    }

    @Override
    public int queryCount(String queryGoodsName, Integer querySupplierId, Integer queryPayStatus) {
        return storageRecordMapper.queryCount(queryGoodsName, querySupplierId, queryPayStatus);
    }
}
